import { defineStore } from "pinia";
import {getStorage,setStorage} from "@/utils/common";
const useInfoStore = defineStore({
    id: "userInfo",
    state: () => ({
      dzkName: "",
      token: "",
      openId:'',
      // 性别
      dzkSex:'',
      // 电子卡id
      dzkIdcard:'',
      // 业主id
      yzId:'',
      // 主卡id
      zkId:'',
      // 电子卡联系方式
      dzkTel:'',
      // 小区名称
      deptName:'',
      // 小区id
      deptId:'',
      // 楼号
      louNumber:'',
      // 单元号
      dyNumber:'',
      // 房间号
      fjNumber:'',
      // 电子业主卡Id
      dzyzkId:'',

    }),
    getters: {
     
    },
    actions: {
     Name(value){
        this.name = value;
      },
      setUserInfo(value){
        this.dzkIdcard = value.dzkIdcard;
        this.yzId = value.yzId;
        this.zkId = value.zkId;
        this.dzkSex = value.dzkSex;
        this.dzyzkId = value.dzyzkId;
        this.dzkName = value.dzkName;
        this.dzkTel = value.dzkTel;
        this.deptName = value.deptName;
        this.deptId = value.deptId;
        this.louNumber = value.louNumber;
        this.dyNumber = value.dyNumber;
        this.fjNumber = value.fjNumber;
      },
      setOpenId(value){
        this.openId = value;
      },
    },
  persist: {
    enabled: true,
  },
  });
  export default useInfoStore;